package it.gameplanet.service;

import it.gameplanet.model.Articolo;
import it.gameplanet.model.Categoria;
import it.gameplanet.model.News;
import it.gameplanet.model.User;

import java.util.List;

import com.google.gwt.user.client.rpc.AsyncCallback;

public interface GamePlanetServiceAsync {
	void findArticoliByCategoria(Categoria categoria, AsyncCallback<List<Articolo>> callback);
	void inserisciArticolo(Articolo articol, AsyncCallback<Void> callback);
	void eliminaArticolo(Articolo articol, AsyncCallback<Void> callback);
	void aggiornaArticolo(Articolo articol, AsyncCallback<Void> callback);
	
	void getCurrentUser(AsyncCallback<User> callback);

	void inserisciCategoria(final String nome, final String parent, AsyncCallback<Void> callback);
	void eliminaCategoria(final String nome, final String parent, AsyncCallback<Void> callback);
	void rinominaCategoria(final String vecchio, final String nuovo, AsyncCallback<Void> callback);
	void findCategorieByParent(final String parent, AsyncCallback<List<Categoria>> callback);

	void findAllNews(final AsyncCallback<List<News>> callback);
	void inserisciNews(final News news, AsyncCallback<Void> callback);
	
	void richiediAcquisto(Articolo articolo, String email, String nome, String cognome, AsyncCallback<Void> callback);	
}
